<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <title>消息管理</title>
    <link rel="stylesheet" href="../../../../public/dist/css/layui.css">
    <link rel="stylesheet" href="../../../../public/font/iconfont.css">
    <link rel="stylesheet" href="../../../../css/twocss/commit.css">
</head>

<body>
    <form class="layui-form" action="">

        <div class="select common">
            <div class="select-title">查询条件</div>



            <div class="select-title select-type">
                <div class="select-type-item select-type-show">
                    全部
                </div>
                <div class="select-type-item">
                    未查看
                </div>
                <div class="select-type-item">
                    已查看
                </div>
                <div class="select-type-item">
                    处理中
                </div>
                <div class="select-type-item">
                    已处理
                </div>
            </div>



            <div class="select-con">

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width:90px;">单号:</label>
                        <div class="layui-input-inline">
                            <input type="text" name="s1"  class="layui-input" search-type="s1" id='s1' placeholder="请输入详细单号">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item" style="display: none">
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="s3"  class="layui-input" search-type="s3" id="s3">
                            </div>
                        </div>
                    </div>
            
               

               

                <div class="select-btn">
                        <div class="layui-bg-green comquery" lay-event="search">查询</div>
                        <div class="layui-bg-green comquery" lay-event="reset">重置</div>
                    </div>
            </div>
        </div>

    </form>

    <div class="common-padding">
            <table class="layui-hide" id="testdome" lay-filter="testdome"></table>
    </div>

</body>

<!-- 头部 -->
<script type="text/html" id="toolbarinter">
    <div class="layui-btn-container ">
        <button class="layui-btn  layui-btn-sm colors" lay-event="add"><i class="layui-icon"></i></i>添加</button>
        <button class="layui-btn  layui-btn-sm colors" lay-event="update"><i class="layui-icon"></i>编辑</button>
        <button class="layui-btn  layui-btn-sm colors" lay-event="delete"><i class="layui-icon"></i>删除</button>
    </div>
</script>

<!-- 里面的查看 -->
<script type="text/html" id="More">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
</script>

<script src="../../../../js/common/jquery.min.js"></script>
<script src="../../../../js/common/api.js"></script>
<script src="../../../../public/dist/layui.js" charset="utf-8"></script>
<script>
    
    layui.config({
        base: '../../../../js/module/'
    }).use(['Services','jquery'],function () {
        var $  = layui.jquery;
        var seeType='';
        var dataType = 'myman';
        var typeItem = document.querySelectorAll('.select-type-item');
        for(var i=0;i<typeItem.length;i++){
            (function(i){
                typeItem[i].addEventListener('click',function(){
                    document.querySelector('.select-type-show').classList.remove('select-type-show');
                    typeItem[i].classList.add('select-type-show');
                    if(i==0){
                        seeType='';
                        document.querySelector('#s3').value='';
                        getServices();

                    }else{
                        seeType=i;
                        document.querySelector('#s3').value=seeType;
                        getServices();
                    }
                })
            })(i)
        }
        getServices();
        function getServices(){
            
            var services = new layui.Services({
                baseURL:baseaip,
                tableId:"testdome",
                toolbar:"#toolbarinter",
                serachUrl:"dictionaries/query",
                getUrl:"dictionaries/get",
                delUrl:"dictionaries/delete",
                updUrl:"plant/updateNcpxx",
                saveUrl:"./dialog/manageDialog.html",
                deleteField:"id",
                dataType:dataType,
                parameter:{
                    keyword:document.querySelector('#s1').value+'|'+seeType,
                    type:dataType
                },
                cols:[[
                    {type: 'checkbox', fixed: 'left'},
                    {field: 's1', sort: true, title: '单号',templet:function (data) {

                            return (JSON.parse(data.context)).s1
                    }},
                    {field: 's2', sort: true, title: '简称',templet:function (data) {
                        
                        return (JSON.parse(data.context)).s2
                    }},
                    {field: 's4', sort: true, title: '平台账号',templet:function (data) {
                        
                        return (JSON.parse(data.context)).s4
                    }},
                    {field: 's2', sort: true, title: '单据信息',templet:function (data) {
                        
                        return (JSON.parse(data.context)).s2
                    }},
                    {field: 's6', sort: true, title: '时间',templet:function (data) {
                        
                        return (JSON.parse(data.context)).s6
                    }},
                    {field: 's3', sort: true, title: '状态',templet:function (data) {
                        var ret = ''
                        if((JSON.parse(data.context)).s3==1){
                            ret = '未查看'
                        }else if((JSON.parse(data.context)).s3==2){
                            ret = '已查看'

                        }else if((JSON.parse(data.context)).s3==3){
                            ret = '处理中'

                        }else if((JSON.parse(data.context)).s3==4){
                            ret = '已处理'

                        }
                       
                        return ret
                    }},
                ]],
            });
        }
        
    });
</script>

</html>